<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
	</body>
	<script src="xml2json.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		// var x2js = new X2JS();
		// var xmlText = "<MyRoot><test>Success</test><test2><item>val1</item><item>val2</item></test2></MyRoot>";
		// var jsonObj = x2js.xml_str2json(xmlText);
		// console.log(jsonObj)



		// var x2js = new X2JS();
		// var jsonObj = {
		// 	MyRoot: {
		// 		test: 'success',
		// 		test2: {
		// 			item: ['val1', 'val2']
		// 		}
		// 	}
		// };
		// var xmlAsStr = x2js.json2xml_str(jsonObj);
		// console.log(xmlAsStr)



		var x2js = new X2JS({
			arrayAccessFormPaths: [
				"MyArrays.test.item"
			]
		});


		var xmlText = "<MyArrays>" +
			"<test><item>success</item><item>second</item></test>" +
			"</MyArrays>";

		var jsonObj = x2js.xml_str2json(xmlText);
		console.log(jsonObj)
	</script>
</html>
